VERSION 5.00
Object = "{1D8AB547-1323-4FDA-BEDB-A2759F814B83}#255.0#0"; "UnicodeFullControl.ocx"
Begin VB.Form main 
   Caption         =   "Calculator"
   ClientHeight    =   7665
   ClientLeft      =   165
   ClientTop       =   555
   ClientWidth     =   5250
   Icon            =   "caculator.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   7665
   ScaleWidth      =   5250
   Begin UnicodeControl.UniButton btmc 
      Height          =   615
      Left            =   120
      TabIndex        =   10
      Top             =   3120
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":038A
      ForeColor       =   12583104
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":03AE
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":03C6
   End
   Begin UnicodeControl.UniFrame UniFrame1 
      Height          =   735
      Left            =   120
      TabIndex        =   5
      Top             =   2160
      Width           =   4935
      _ExtentX        =   8705
      _ExtentY        =   1296
      BackColor       =   -2147483633
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OldHeight       =   735
      UniToolTipText  =   "caculator.frx":03DE
      Caption         =   "caculator.frx":03F6
      ForeColor       =   -2147483635
      ForeHighlight   =   0
      ShowButton      =   0   'False
      Picture         =   "caculator.frx":040E
      PictureType     =   0
      Begin UnicodeControl.UniOption opoct 
         Height          =   360
         Left            =   2760
         TabIndex        =   9
         Top             =   240
         Width           =   735
         _ExtentX        =   1296
         _ExtentY        =   635
         Caption         =   "caculator.frx":0426
         BackColor       =   -2147483633
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   12582912
         Style           =   0
         AutoSize        =   -1  'True
         UniToolTipText  =   "caculator.frx":044C
         Theme           =   ""
      End
      Begin UnicodeControl.UniOption opbin 
         Height          =   360
         Left            =   3840
         TabIndex        =   8
         Top             =   240
         Width           =   705
         _ExtentX        =   1244
         _ExtentY        =   635
         Caption         =   "caculator.frx":0464
         BackColor       =   -2147483633
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   12582912
         Style           =   0
         AutoSize        =   -1  'True
         UniToolTipText  =   "caculator.frx":048A
         Theme           =   ""
      End
      Begin UnicodeControl.UniOption opdec 
         Height          =   360
         Left            =   1440
         TabIndex        =   7
         Top             =   240
         Width           =   795
         _ExtentX        =   1402
         _ExtentY        =   635
         Value           =   -1  'True
         Caption         =   "caculator.frx":04A2
         BackColor       =   -2147483633
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   12582912
         Style           =   0
         AutoSize        =   -1  'True
         UniToolTipText  =   "caculator.frx":04C8
         Theme           =   ""
      End
      Begin UnicodeControl.UniOption ophex 
         Height          =   360
         Left            =   240
         TabIndex        =   6
         Top             =   240
         Width           =   780
         _ExtentX        =   1376
         _ExtentY        =   635
         Caption         =   "caculator.frx":04E0
         BackColor       =   -2147483633
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   16711680
         Style           =   0
         AutoSize        =   -1  'True
         UniToolTipText  =   "caculator.frx":0506
         Theme           =   ""
      End
   End
   Begin UnicodeControl.UniButton btbs 
      Height          =   495
      Left            =   960
      TabIndex        =   1
      Top             =   1680
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   873
      Caption         =   "caculator.frx":051E
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0550
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0568
   End
   Begin UnicodeControl.UniTextBox txtkq 
      Height          =   555
      Left            =   120
      TabIndex        =   0
      Top             =   840
      Width           =   4935
      _ExtentX        =   8705
      _ExtentY        =   979
      Alignment       =   1
      UniToolTipText  =   "caculator.frx":0580
      Appearance      =   0
      BackColor       =   -2147483643
      BorderStyle     =   2
      CaptureEnter    =   0   'False
      CaptureEsc      =   0   'False
      CaptureTab      =   0   'False
      Enabled         =   -1  'True
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   -2147483640
      HideSelection   =   -1  'True
      Locked          =   0   'False
      MaxLength       =   -1
      MouseIcon       =   "caculator.frx":0598
      MousePointer    =   0
      MultiLine       =   0   'False
      PasswordChar    =   ""
      RightToLeft     =   0   'False
      ScrollBars      =   0
      Text            =   "caculator.frx":05B4
      UseEvents       =   -1  'True
   End
   Begin UnicodeControl.UniButton btce 
      Height          =   495
      Left            =   2880
      TabIndex        =   2
      Top             =   1680
      Width           =   1215
      _ExtentX        =   2143
      _ExtentY        =   873
      Caption         =   "caculator.frx":05D4
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":05F8
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0610
   End
   Begin UnicodeControl.UniButton btc 
      Height          =   495
      Left            =   4200
      TabIndex        =   3
      Top             =   1680
      Width           =   855
      _ExtentX        =   1508
      _ExtentY        =   873
      Caption         =   "caculator.frx":0628
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":064A
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0662
   End
   Begin UnicodeControl.UniButton btsonho 
      Height          =   495
      Left            =   120
      TabIndex        =   4
      Top             =   1680
      Width           =   735
      _ExtentX        =   1296
      _ExtentY        =   873
      Caption         =   "caculator.frx":067A
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0692
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":06AA
   End
   Begin UnicodeControl.UniButton btmr 
      Height          =   615
      Left            =   120
      TabIndex        =   11
      Top             =   3840
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":06C2
      ForeColor       =   12583104
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":06E6
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":06FE
   End
   Begin UnicodeControl.UniButton btms 
      Height          =   615
      Left            =   120
      TabIndex        =   12
      Top             =   4560
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0716
      ForeColor       =   12583104
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":073A
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0752
   End
   Begin UnicodeControl.UniButton btmcc 
      Height          =   615
      Left            =   120
      TabIndex        =   13
      Top             =   5280
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":076A
      ForeColor       =   12583104
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":078E
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":07A6
   End
   Begin UnicodeControl.UniButton btsin 
      Height          =   615
      Left            =   120
      TabIndex        =   14
      Top             =   6000
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":07BE
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":07E4
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":07FC
   End
   Begin UnicodeControl.UniButton btcos 
      Height          =   615
      Left            =   120
      TabIndex        =   15
      Top             =   6720
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0814
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":083A
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0852
   End
   Begin UnicodeControl.UniButton bt7 
      Height          =   615
      Left            =   840
      TabIndex        =   16
      Top             =   3120
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":086A
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":088C
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":08A4
   End
   Begin UnicodeControl.UniButton bt5 
      Height          =   615
      Left            =   1560
      TabIndex        =   17
      Top             =   3840
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":08BC
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":08DE
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":08F6
   End
   Begin UnicodeControl.UniButton bt9 
      Height          =   615
      Left            =   2280
      TabIndex        =   18
      Top             =   3120
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":090E
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0930
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0948
   End
   Begin UnicodeControl.UniButton bt8 
      Height          =   615
      Left            =   1560
      TabIndex        =   19
      Top             =   3120
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0960
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0982
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":099A
   End
   Begin UnicodeControl.UniButton bt3 
      Height          =   615
      Left            =   840
      TabIndex        =   20
      Top             =   4560
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":09B2
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":09D4
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":09EC
   End
   Begin UnicodeControl.UniButton bt4 
      Height          =   615
      Left            =   840
      TabIndex        =   21
      Top             =   3840
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0A04
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0A26
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0A3E
   End
   Begin UnicodeControl.UniButton bt0 
      Height          =   615
      Left            =   840
      TabIndex        =   22
      Top             =   5280
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0A56
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0A78
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0A90
   End
   Begin UnicodeControl.UniButton bt6 
      Height          =   615
      Left            =   2280
      TabIndex        =   23
      Top             =   3840
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0AA8
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0ACA
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0AE2
   End
   Begin UnicodeControl.UniButton bt1 
      Height          =   615
      Left            =   2280
      TabIndex        =   24
      Top             =   4560
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0AFA
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0B1C
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0B34
   End
   Begin UnicodeControl.UniButton bt2 
      Height          =   615
      Left            =   1560
      TabIndex        =   25
      Top             =   4560
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0B4C
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0B6E
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0B86
   End
   Begin UnicodeControl.UniButton btcongtru 
      Height          =   615
      Left            =   1560
      TabIndex        =   26
      Top             =   5280
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0B9E
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0BC4
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0BDC
   End
   Begin UnicodeControl.UniButton btnhan 
      Height          =   615
      Left            =   3000
      TabIndex        =   27
      Top             =   3120
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0BF4
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0C16
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0C2E
   End
   Begin UnicodeControl.UniButton btcham 
      Height          =   615
      Left            =   2280
      TabIndex        =   28
      Top             =   5280
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0C46
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0C68
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0C80
   End
   Begin UnicodeControl.UniButton btsqrt 
      Height          =   615
      Left            =   4080
      TabIndex        =   29
      Top             =   3120
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0C98
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0CC0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0CD8
   End
   Begin UnicodeControl.UniButton btcong 
      Height          =   615
      Left            =   3000
      TabIndex        =   30
      Top             =   5280
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0CF0
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0D12
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0D2A
   End
   Begin UnicodeControl.UniButton bttru 
      Height          =   615
      Left            =   3000
      TabIndex        =   31
      Top             =   4560
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0D42
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0D64
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0D7C
   End
   Begin UnicodeControl.UniButton btchia 
      Height          =   615
      Left            =   3000
      TabIndex        =   32
      Top             =   3840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0D94
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0DB6
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0DCE
   End
   Begin UnicodeControl.UniButton btxmuy 
      Height          =   615
      Left            =   4080
      TabIndex        =   33
      Top             =   6000
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0DE6
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0E0C
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0E24
   End
   Begin UnicodeControl.UniButton btbang 
      Height          =   615
      Left            =   4080
      TabIndex        =   34
      Top             =   5280
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0E3C
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0E5E
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0E76
   End
   Begin UnicodeControl.UniButton bt1chia 
      Height          =   615
      Left            =   4080
      TabIndex        =   35
      Top             =   4560
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0E8E
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0EB4
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0ECC
   End
   Begin UnicodeControl.UniButton btphantram 
      Height          =   615
      Left            =   4080
      TabIndex        =   36
      Top             =   3840
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0EE4
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0F06
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0F1E
   End
   Begin UnicodeControl.UniButton btlog 
      Height          =   615
      Left            =   4080
      TabIndex        =   37
      Top             =   6720
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0F36
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0F5C
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0F74
   End
   Begin UnicodeControl.UniButton btbphuong 
      Height          =   615
      Left            =   3000
      TabIndex        =   38
      Top             =   6720
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0F8C
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":0FB2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":0FCA
   End
   Begin UnicodeControl.UniButton btgiaithua 
      Height          =   615
      Left            =   3000
      TabIndex        =   39
      Top             =   6000
      Width           =   975
      _ExtentX        =   1720
      _ExtentY        =   1085
      Caption         =   "caculator.frx":0FE2
      ForeColor       =   255
      ForecolorSelected=   0
      UniToolTipText  =   "caculator.frx":1006
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":101E
   End
   Begin UnicodeControl.UniButton btc2 
      Height          =   615
      Left            =   2280
      TabIndex        =   40
      Top             =   6000
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":1036
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":1058
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":1070
   End
   Begin UnicodeControl.UniButton btb 
      Height          =   615
      Left            =   1560
      TabIndex        =   41
      Top             =   6000
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":1088
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":10AA
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":10C2
   End
   Begin UnicodeControl.UniButton bta 
      Height          =   615
      Left            =   840
      TabIndex        =   42
      Top             =   6000
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":10DA
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":10FC
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":1114
   End
   Begin UnicodeControl.UniButton btd 
      Height          =   615
      Left            =   840
      TabIndex        =   43
      Top             =   6720
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":112C
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":114E
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":1166
   End
   Begin UnicodeControl.UniButton btf 
      Height          =   615
      Left            =   2280
      TabIndex        =   44
      Top             =   6720
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":117E
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":11A0
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":11B8
   End
   Begin UnicodeControl.UniButton bte 
      Height          =   615
      Left            =   1560
      TabIndex        =   45
      Top             =   6720
      Width           =   615
      _ExtentX        =   1085
      _ExtentY        =   1085
      Caption         =   "caculator.frx":11D0
      ForeColor       =   64
      ForecolorSelected=   0
      ButtonColor     =   192
      UniToolTipText  =   "caculator.frx":11F2
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      EnableDoubleClick=   -1  'True
      Picture         =   "caculator.frx":120A
   End
   Begin VB.Menu huongdan 
      Caption         =   "Huong dan"
   End
   Begin VB.Menu thoat 
      Caption         =   "Thoat"
   End
End
Attribute VB_Name = "main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Sub doisonho()
    
    Select Case heso
        Case 10
        txtkq.Text = sonho 'khi dang o he so 10 thi so nho =text
        Case 16
        txtkq.Text = Hex(sonho) 'khi dang o he so 16 thi chuyen sang he 16
        Case 8
        txtkq.Text = dectooct(sonho) ' chuyen sang he 8
        Case 2
        txtkq.Text = dectobin(sonho) ' chuyen sang he 2
    End Select
End Sub
Sub laytoanhang1()
'khi chon phep toan xong thi cap nhat lai gia tri cho th1
    Select Case heso
        Case 10
        th1 = Val(txtkq.Text)
        Case 16
        th1 = hextodec(txtkq.Text)
        Case 8
        th1 = octtodec(txtkq.Text)
        Case 2
        th1 = bintodec(txtkq.Text)
    End Select
End Sub
Sub hienketqua()
'ket qua cua moi phep toan deu duoc tinh tren he so 10 vi the
'phai kiem tra he so nao dang duoc chon va chuyen sang he so tuong ung
    Select Case heso
        Case 10
        txtkq.Text = ketqua
        Case 16
        txtkq.Text = Hex(ketqua) ' chuyen sang 16
        Case 8
        txtkq.Text = dectooct(ketqua) 'chuyen sang 8
        Case 2
        txtkq.Text = dectobin(ketqua) 'chuyen sang 2
    End Select
End Sub
 
Sub cong()
    ' khi chon phep cong bien kt bac len de cho biet co phep toan duoc chon
    ' chi cong khi text co gia tri va phep cong duoc bac len roi
    ' cong xong cap nhat gia tri cho th1
    kt = True
    If co = True And pheptoan = "+" Then
        ketqua = th1 + th2
        hienketqua
    End If
    co = False
    pheptoan = "+"
    laytoanhang1
   
End Sub
Sub tru()
    kt = True
    If co = True And pheptoan = "-" Then
        ketqua = th1 - th2
        hienketqua
    End If
    co = False
    pheptoan = "-"
    laytoanhang1
   End Sub
Sub nhan()
    kt = True
    If co = True And pheptoan = "*" Then
    ketqua = th1 * th2
        hienketqua
    End If
    co = False
    pheptoan = "*"
   laytoanhang1
  
End Sub
Sub chia()
        kt = True
        If co = True And pheptoan = "/" Then
        If th2 = 0 Then
            txtkq.Text = "Khong the chia cho 0!"
        Else
        ketqua = th1 / th2
        hienketqua
            End If
        End If
        co = Falses
        pheptoan = "/"
        laytoanhang1
End Sub
Sub luythua()
    kt = True
    If co = True And pheptoan = "lt" Then
     ketqua = th1 ^ th2
        hienketqua
  
    End If
    co = False
    pheptoan = "lt"
    laytoanhang1

End Sub
Sub binhphuong()
    kt = True
    If co = True Then
    On Error GoTo loi
    txtkq.Text = (Val(txtkq.Text)) * (Val(txtkq.Text))
    pheptoan = "bp"
    End If
    Exit Sub
loi:
    txtkq.Text = "So lon hon gioi han cho phep"
    pheptoan = "bp"
    co = False
End Sub
Private Sub bt0_Click()
    
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    If txtkq.Text <> "" Then
    txtkq.Text = txtkq.Text & 0
    End If
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt1_Click()

    
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 1
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
   
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt1chia_Click()
    kt = True
    If co = True Then
    txtkq.Text = 1 / Val(txtkq.Text)
    End If
     btbs.Enabled = False
End Sub

Private Sub bt2_Click()
      
   If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 2
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
  
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt3_Click()

If daubang = True Then
    ketqua = 0
    End If
If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 3
   Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt4_Click()

    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 4
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt5_Click()
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 5
   Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
   
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt6_Click()
   
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 6
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
       co = True
    btbs.Enabled = True
End Sub


Private Sub bt7_Click()
   'bien kt =false thi moi chon so duoc
    If kt = True Then  'kiem tra xem co phen toan nao duoc chon khong
    txtkq = ""          'neu co phep toan duoc chon thi dua text ve rong
    kt = False          'va dat lai bien kt=false de chon so
    End If              'va phai kiem tra xem dang chon he so nao
                ' neu la he so 16 thi chuyen gia tri tren text tu 16 sang 10
                'neu la he so 8 thi chuyen tu 8 sang 10
                'he 2 cung vay, khi chon so thi dat th2 = text vi khi de thuc
                'hien phep toan chung ta can phai co gia tri truoc sau do moi thuc
                'khi chon phep toan xong th1= text
                'khi chon so xong thi co duoc bac len de cho biet la text da
                'co gia tri san sang cho 1 phep toan, khi nhap so sai nut
                'backspace duoc bac len cho phep xoa
    txtkq.Text = txtkq.Text & 7
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
     pheptoan = ""
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt8_Click()
     
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 8
   Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bt9_Click()
If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & 9
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bta_Click()
   
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "A"
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub btb_Click()
   If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "B"
    'th2 = Val(txtkq.Text)
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub btbang_Click()
     
    If pheptoan = "-" Then
        tru
    ElseIf pheptoan = "*" Then
        nhan
    ElseIf pheptoan = "+" Then
        
        cong
    ElseIf pheptoan = "/" Then
        chia
    ElseIf pheptoan = "lt" Then
        luythua
    End If
    co = False
    pheptoan = ""
    btbs.Enabled = False
End Sub

Private Sub btbphuong_Click()
    kt = True
    If co = True Then
    On Error GoTo loigt
    txtkq.Text = (Val(txtkq.Text)) * (Val(txtkq.Text))
    End If
    Exit Sub
loigt:
    txtkq.Text = "So lon hon gioi han cho phep"
    co = False
    btbs.Enabled = False
End Sub

Private Sub btbs_Click()
    If Len(txtkq.Text) >= 1 Then
        txtkq.Text = Left(txtkq.Text, Len(txtkq.Text) - 1)
    End If
    th2 = Val(txtkq.Text)
End Sub

Private Sub btc_Click()
    txtkq.Text = ""
    th1 = 0
    th2 = 0
    sonho = 0
    btsonho.Caption = ""
End Sub

Private Sub btc2_Click()
   
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "C"
    'th2 = Val(txtkq.Text)
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    Text1 = th2
    co = True
    btbs.Enabled = True
End Sub

Private Sub btce_Click()
    txtkq.Text = ""
    th2 = 0
End Sub

Private Sub btcham_Click()
    If kt = False Then
        If txtkq.Text = "" Then txtkq.Text = "0."
        If (InStr(1, txtkq.Text, ".")) = 0 Then txtkq.Text = txtkq.Text + "."
       
    Else
        txtkq.Text = "0."
    End If
    kt = False
End Sub

Private Sub btchia_Click()
    If pheptoan = "-" Then
    tru
    ElseIf pheptoan = "*" Then
    nhan
    ElseIf pheptoan = "+" Then
    cong
    ElseIf pheptoan = "lt" Then
    luythua
    End If
    chia
    btbs.Enabled = False
End Sub

Private Sub btcong_Click()
    If pheptoan = "-" Then
    tru
    ElseIf pheptoan = "*" Then
    nhan
    ElseIf pheptoan = "/" Then
    chia
    ElseIf pheptoan = "lt" Then
    luythua
    End If
    cong
    btbs.Enabled = False
End Sub

Private Sub btcongtru_Click()
    kt = True
    If co = True Then
    txtkq.Text = -(Val(txtkq.Text))
    End If
    'co = False
    th2 = Val(txtkq.Text)
End Sub

Private Sub btcos_Click()
    pi = 4 * Atn(1)
    kt = True
    If co = True Then
        Dim so As Double: so = Val(txtkq.Text)
        Dim lg As Double
        lg = Round(Cos(so / 180 * pi), 22)
        If Abs(lg) < 0.000001 Then
        txtkq.Text = 0
        Else
        txtkq.Text = lg
        End If
    End If
     btbs.Enabled = False
End Sub

Private Sub btd_Click()
  
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "D"
    'th2 = Val(txtkq.Text)
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
    co = True
    btbs.Enabled = True
End Sub

Private Sub bte_Click()
   
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "E"
    'th2 = Val(txtkq.Text)
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
   
    co = True
    btbs.Enabled = True
End Sub

Private Sub btf_Click()
    
    If kt = True Then
    txtkq = ""
    kt = False
    End If
    txtkq.Text = txtkq.Text & "F"
    'th2 = Val(txtkq.Text)
    Select Case heso
        Case 10
        th2 = Val(txtkq)
        Case 16
        th2 = hextodec(txtkq.Text)
        Case 8
        th2 = octtodec(txtkq)
        Case 2
        th2 = bintodec(txtkq)
    End Select
   
    co = True
    btbs.Enabled = True
End Sub

Private Sub btgiaithua_Click()
    kt = True
    If co = True Then
    On Error GoTo loigt
    
    ketqua = giaithua(Val(th2))
    hienketqua
    End If
    Exit Sub
loigt:
    txtkq.Text = "So lon hon gioi han cho phep"
    'co = False
     btbs.Enabled = False
End Sub

Private Sub btlog_Click()
    kt = True
    If co = True Then
    txtkq.Text = Log(Val(txtkq.Text))
    End If
    co = False
     btbs.Enabled = False
End Sub

Private Sub btmc_Click()
    ' xoa so nho, se gan gia tri cho so nho=0
    ' caption cua nut btsonho = rong, cho biet so nho khong con gia tri
    sonho = 0
    btsonho.Caption = ""
End Sub

Private Sub btmcc_Click()
'cong them so nho, gia tri tang len khi text co gia tri khac 0
If txtkq.Text <> "" And txtkq.Text <> "0" Then
    sonho = sonho + Val(txtkq.Text)
    btsonho.Caption = "M"
End If
End Sub

Private Sub btmr_Click()
'hien thi so nho ra text
'khi chon qua lai giua cac he so, so nho cung doi theo
    doisonho
    th2 = Val(txtkq.Text)
    co = True
End Sub

Private Sub btms_Click()
'so nho duoc bac len khi text co gia tri khac 0
    If txtkq.Text <> "" And txtkq.Text <> "0" Then
    sonho = Val(txtkq.Text)
    btsonho.Caption = "M"
    End If
End Sub

Private Sub btnhan_Click()
' neu truoc do la phep tru thi phai tru truoc
'neu la phep cong phai cong truoc roi moi nhan
    If pheptoan = "-" Then
    tru
    ElseIf pheptoan = "+" Then
    cong
    ElseIf pheptoan = "/" Then
    chia
    ElseIf pheptoan = "lt" Then
    luythua
    End If
    nhan
    btbs.Enabled = False
End Sub

Private Sub btphantram_Click()
    kt = True
    If co = True Then
    txtkq.Text = Val(txtkq.Text) / 100
    End If
    btbs.Enabled = False
End Sub

Private Sub btsin_Click()
    pi = 4 * Atn(1)
    kt = True
    If co = True Then
        Dim so As Double: so = Val(txtkq.Text)
        Dim kq As Double
        kq = Round(Sin(so / 180 * pi), 22) ' sin trong vb tinh theo radian
        If Abs(kq) < 0.000001 Then
        txtkq.Text = 0
        Else
        txtkq.Text = kq
        End If
    End If
     btbs.Enabled = False
End Sub

Private Sub btsqrt_Click()
    kt = True
    If co = True Then
    txtkq.Text = Sqr(Val(txtkq.Text))
    End If
    btbs.Enabled = False
End Sub

Private Sub bttru_Click()
    If pheptoan = "+" Then
    cong
    ElseIf pheptoan = "*" Then
    nhan
    ElseIf pheptoan = "/" Then
    chia
    ElseIf pheptoan = "lt" Then
    luythua
    End If
    tru
    btbs.Enabled = False
End Sub

Private Sub btxmuy_Click()
    If pheptoan = "-" Then
    tru
    ElseIf pheptoan = "*" Then
    nhan
    ElseIf pheptoan = "/" Then
    chia
    ElseIf pheptoan = "+" Then
    cong
    End If
    luythua
     btbs.Enabled = False
End Sub

Private Sub Form_Load()
    opdec_Click
    'th1 = Val(txtkq.Text)
    pheptoan = ""
End Sub

Private Sub huongdan_Click()
    Form1.Show
End Sub

Private Sub opbin_Click()
    chonbin
    If txtkq.Text <> "" Then
    If heso = 10 Then
        If Val(txtkq.Text) >= 0 Then
            txtkq.Text = dectobin(Val(txtkq.Text))
        Else
            MsgBox ("Khong thuc hien duoc")
            chondec
            opdec.Value = True
            Exit Sub
        End If
    ElseIf heso = 16 Then
        txtkq.Text = dectobin(hextodec((txtkq.Text)))
    ElseIf heso = 8 Then
        txtkq.Text = dectobin(octtodec((txtkq.Text)))
    End If
    End If
     heso = 2
End Sub

Private Sub opdec_Click()
'goi sub chondec kiem tra neu text la rong thi ko lam gi ca, neu dang o he so 2
' thi chuyen tu 2 sang 10, neu dang o he so 8 thi chuyen 8 sang 10,....
    chondec
    If txtkq.Text <> "" Then
        If heso = 2 Then
            txtkq.Text = bintodec((txtkq.Text))
        ElseIf heso = 8 Then
            txtkq.Text = octtodec((txtkq.Text))
        ElseIf heso = 16 Then
            txtkq.Text = hextodec(txtkq.Text)
        End If
    End If
    heso = 10
End Sub

Private Sub ophex_Click()
    chonhex
    If txtkq.Text <> "" Then
    If heso = 10 Then
        txtkq.Text = Hex(Val(txtkq.Text))
    ElseIf heso = 8 Then
        txtkq.Text = Hex(octtodec((txtkq.Text)))
    ElseIf heso = 2 Then
        txtkq.Text = Hex(bintodec((txtkq.Text)))
    End If
    End If
    heso = 16
End Sub

Private Sub opoct_Click()
    chonoct
    If txtkq.Text <> "" Then
    If heso = 10 Then
        txtkq.Text = Oct(Val(txtkq.Text))
    ElseIf heso = 16 Then
        txtkq.Text = Oct(hextodec((txtkq.Text)))
    ElseIf heso = 2 Then
        txtkq.Text = Oct(bintodec((txtkq.Text)))
    End If
    End If
    heso = 8
End Sub

Private Sub vang_Click()
    main.BackColor = vbYellow
End Sub

Private Sub xanhd_Click()
    main.BackColor = vbBlue
End Sub

Private Sub xanhla_Click()
    main.BackColor = vbGreen
End Sub

Private Sub thoat_Click()
    End
End Sub
